import os

from dotenv import find_dotenv, load_dotenv


env_path = os.path.join(os.path.dirname(__file__),'root.env')

if os.path.exists(env_path):
    load_dotenv(find_dotenv(filename=env_path))
else:
    raise FileExistsError('Configuration file does not exit !')

#[Web]
HTTP_HOST = os.getenv("HTTP_HOST")
HTTP_PORT = int(os.getenv("HTTP_PORT"))
HTTP_RELOAD = os.getenv("HTTP_RELOAD")
DEBUG = True

# [MYSQL]
DB_HOST = os.getenv('DB_HOST')
DB_PORT = int(os.getenv("DB_PORT"))
DB_USER = os.getenv('DB_USER')
DB_PASSWORD = os.getenv('DB_PASSWORD')
DATABASE = os.getenv('DATABASE')

# [REDIS]
REDIS_HOST = os.getenv("REDIS_HOST")
REDIS_PORT = int(os.getenv("REDIS_PORT"))

# [secret_key]
SECRET_KEY = os.getenv('SECRET_KEY')
ALGORITHM = os.getenv('ALGORITHM')
ACCESS_TOKEN_EXPIRE_MINUTES = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES"))